//
//  BackTableViewCell.m
//  QRMaster
//
//  Created by myApple on 15/7/17.
//  Copyright (c) 2015年 myApple. All rights reserved.
//

#import "BackTableViewCell.h"

@interface BackTableViewCell()
{
    UIImageView * headerImgView;
    UILabel * contentLabel;
}

@end

@implementation BackTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        [self prepareView];
    }
    return self;
}

-(void)prepareView
{
    float ScreenWidth = self.frame.size.width;
    float x = 10;
    float y = 10;
    float width = 20;
    float height = 20;
    headerImgView = [[UIImageView alloc]initWithFrame:CGRectMake(x, y, width, height)];
    [self.contentView addSubview:headerImgView];
    
    x += width + 10;
    width = ScreenWidth - x - 10;
    contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(x, y, width, height)];
    contentLabel.textColor = [UIColor whiteColor];
    contentLabel.font = [UIFont systemFontOfSize:14.0];
    [self.contentView addSubview:contentLabel];
    
    x = 10;
    width = 118;
    height = 0.5;
    y = 39.5;
    UIView * lineView = [[UIView alloc]initWithFrame:CGRectMake(x, y, width, height)];
    lineView.backgroundColor = [UIColor colorWithRed:81 / 255.0 green:81 / 255.0  blue:81 / 255.0  alpha:1];
    [self.contentView addSubview:lineView];
}


-(void)setImgString:(NSString *)imgString
{
    _imgString = imgString;
    headerImgView.image = [UIImage imageNamed:imgString];
}

-(void)setContent:(NSString *)content
{
    _content = content;
    contentLabel.text = content;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
